import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/wareAllot/addOrSave',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/wareAllot/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/wareAllot/addOrSave',
    method: 'post',
    data
  })
}

export function copy(data) {
  return request({
    url: 'api/wareAllot/copy',
    method: 'post',
    data
  })
}

export function exportDe(data) {
  return request({
    url: 'api/wareAllot/export',
    method: 'post',
    data
  })
}

export function importDe(data) {
  return request({
    url: 'api/wareAllot/import',
    method: 'post',
    data
  })
}

export function passOrReject(data) {
  const obj = {
    url: 'api/wareAllot/passOrReject',
    method: 'post',
    data
  }
  return request(obj)
}
export function enableOrDisable(data) {
  const obj = {
    url: 'api/wareAllot/passOrReject',
    method: 'post',
    data
  }
  return request(obj)
}

export function exportDetail(data) {
  const obj = {
    url: 'api/wareAllot/exportDetail',
    method: 'get',
    data
  }
  return request(obj)
}

export function passIn(data) {
  const obj = {
    url: 'api/wareAllot/passIn',
    method: 'post',
    data
  }
  return request(obj)
}
export function passOut(data) {
  const obj = {
    url: 'api/wareAllot/passOut',
    method: 'post',
    data
  }
  return request(obj)
}
export function rejectOut(data) {
  const obj = {
    url: 'api/wareAllot/rejectOut',
    method: 'post',
    data
  }
  return request(obj)
}

export function removeDetail(data) {
  const obj = {
    url: 'api/wareAllot/removeDetail',
    method: 'post',
    data
  }
  return request(obj)
}
export function reverseAllot(data) {
  const obj = {
    url: 'api/wareAllot/reverseAllot',
    method: 'post',
    data
  }
  return request(obj)
}

export function print(data) {
  const obj = {
    url: 'api/wareAllot/print',
    method: 'post',
    responseType: 'blob',
    data
  }
  return request(obj)
}

export default { add, edit, copy, exportDe, importDe, del, passOrReject, enableOrDisable, exportDetail, passIn, passOut, rejectOut, removeDetail, reverseAllot, print }
